<?php
namespace Admin\Controller;
use Think\Controller;
class AbsentController extends AclController {
    // PC 获取用户
    public function getAbsent($page=1,$rows=20,$username=''){
    	$user=M('view_absent');
        //筛选条件
        $condition=array();
        if(!empty($username)){
            $condition['stuname']=array('like','%'.$username.'%');
        }
        //取哪几条
        $limit=($page-1)*$rows.','.$rows;
        //总条数
        $count=$user->where($condition)->count();
        //行数据
    	$data=$user->where($condition)->limit($limit)->select();
    	// echo $user->getLastSql();
        $this->ajaxReturn(array('total'=>$count,'rows'=>$data));
    }
}